﻿using ControleRepresentante.Data.Catalogs;
using ControleRepresentante.Data.Helpers;

namespace ControleRepresentante.Data.CatalogSteps
{
    internal class CreateVendedorCatalogStep : CatalogStepBase<ControleRepresentanteCatalogStepTypes>
    {
        protected override ControleRepresentanteCatalogStepTypes CatalogStepType
        {
            get { return ControleRepresentanteCatalogStepTypes.CreateVendedor; }
        }

        public override void Execute(IDataAccess dataAccess)
        {
            CatalogStepHelper catalogStepHelper = new CatalogStepHelper(dataAccess);

            catalogStepHelper
                .CreateTable("Vendedor", false, "UsuariosHolderId")
                    .AddForeignKey("UsuariosHolderId", "UsuariosHolder", "DetailsHolderId")
                    .AddColumn("Nome", ColumnType.ShortString, false, false)
                    .AddColumn("Nascimento", ColumnType.DateTime, true, false)
                    .AddColumn("Identidade", ColumnType.ShortString, true, false)
                    .AddColumn("CPF", ColumnType.ShortString, true, false);
        }
    }
}